buildable: Make vfunc accessor functions private
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 25 Sep 2020 12:27:26 +0000 (14:27 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Sep 2020 00:16:57 +0000 (02:16 +0200)
With the exception of gtk_buildable_get_id(), those are only used
to construct objects from XML descriptions, which is functionality
internal to GTK.

The API is therefore unlikely to be missed, and keeping it internal
means they can no longer unintentionally shadow object methods in
bindings with less namespacing; for example it's currently ambiguous
whether `infoBar.add_child()` refers to gtk_info_bar_add_child() or
gtk_buildable_add_child().

https://gitlab.gnome.org/GNOME/gtk/-/issues/3191

docs/reference/gtk/gtk4-sections.txt
gtk/gtkbuildable.c
gtk/gtkbuildable.h
gtk/gtkbuildableprivate.h [new file with mode: 0644]
gtk/gtkbuilder-menus.c
gtk/gtkbuilder.c
gtk/gtkbuilderparser.c
gtk/gtkbuilderprecompile.c

index d93c23e29791109902953e1618610abebe031803..b0bbd9cb1d771672282931d6de2315dd9f67d927 100644 (file)
@@ -617,16 +617,7 @@ gtk_grid_view_get_type
 GtkBuildable
 GtkBuildableIface
 GtkBuildableParser
-gtk_buildable_set_buildable_id
 gtk_buildable_get_buildable_id
-gtk_buildable_add_child
-gtk_buildable_set_buildable_property
-gtk_buildable_construct_child
-gtk_buildable_custom_tag_start
-gtk_buildable_custom_tag_end
-gtk_buildable_custom_finished
-gtk_buildable_parser_finished
-gtk_buildable_get_internal_child
 <SUBSECTION Standard>
 GTK_BUILDABLE
 GTK_IS_BUILDABLE
index 8e73e20b4a18b13bf516941976ac097f3586a9ff..dd0e33040d5ec635eccc3265b313f3ef02cc72a8 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "config.h"
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
 #include "gtkintl.h"
 
 
index 9cb69dcaa3e96299c72694b6707413b37e9d979e..ed0dbdd25a0f5bde7d72cf4aea8c01fbe598962c 100644 (file)
@@ -168,51 +168,8 @@ struct _GtkBuildableIface
 GDK_AVAILABLE_IN_ALL
 GType     gtk_buildable_get_type               (void) G_GNUC_CONST;
 
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_set_buildable_id       (GtkBuildable        *buildable,
-                                               const char          *id);
 GDK_AVAILABLE_IN_ALL
 const char * gtk_buildable_get_buildable_id    (GtkBuildable        *buildable);
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_add_child              (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               GObject             *child,
-                                               const char          *type);
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_set_buildable_property (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               const char          *name,
-                                               const GValue        *value);
-GDK_AVAILABLE_IN_ALL
-GObject * gtk_buildable_construct_child        (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               const char          *name);
-GDK_AVAILABLE_IN_ALL
-gboolean  gtk_buildable_custom_tag_start       (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               GObject             *child,
-                                               const char          *tagname,
-                                               GtkBuildableParser  *parser,
-                                               gpointer            *data);
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_custom_tag_end         (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               GObject             *child,
-                                               const char          *tagname,
-                                               gpointer             data);
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_custom_finished        (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               GObject             *child,
-                                               const char          *tagname,
-                                               gpointer             data);
-GDK_AVAILABLE_IN_ALL
-void      gtk_buildable_parser_finished        (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder);
-GDK_AVAILABLE_IN_ALL
-GObject * gtk_buildable_get_internal_child     (GtkBuildable        *buildable,
-                                               GtkBuilder          *builder,
-                                               const char          *childname);
 
 GDK_AVAILABLE_IN_ALL
 void          gtk_buildable_parse_context_push              (GtkBuildableParseContext *context,
diff --git a/gtk/gtkbuildableprivate.h b/gtk/gtkbuildableprivate.h
new file mode 100644 (file)
index 0000000..305be21
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __GTK_BUILDABLE_PRIVATE_H__
+#define __GTK_BUILDABLE_PRIVATE_H__
+
+#include "gtkbuildable.h"
+
+G_BEGIN_DECLS
+
+void      gtk_buildable_set_buildable_id       (GtkBuildable        *buildable,
+                                                const char          *id);
+void      gtk_buildable_add_child              (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                GObject             *child,
+                                                const char          *type);
+void      gtk_buildable_set_buildable_property (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                const char          *name,
+                                                const GValue        *value);
+GObject * gtk_buildable_construct_child        (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                const char          *name);
+gboolean  gtk_buildable_custom_tag_start       (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                GObject             *child,
+                                                const char          *tagname,
+                                                GtkBuildableParser  *parser,
+                                                gpointer            *data);
+void      gtk_buildable_custom_tag_end         (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                GObject             *child,
+                                                const char          *tagname,
+                                                gpointer             data);
+void      gtk_buildable_custom_finished        (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                GObject             *child,
+                                                const char          *tagname,
+                                                gpointer             data);
+void      gtk_buildable_parser_finished        (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder);
+GObject * gtk_buildable_get_internal_child     (GtkBuildable        *buildable,
+                                                GtkBuilder          *builder,
+                                                const char          *childname);
+
+G_END_DECLS
+
+#endif /* __GTK_BUILDABLE_PRIVATE_H__ */
index aca07e3f2eb7f01251d256b260ea344af85939bd..0bc7c1ed7888554d167193e4566fe68a1527acc1 100644 (file)
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include "gtkbuilderprivate.h"
+#include "gtkbuildableprivate.h"
 #include "gtkintl.h"
 
 #include <gio/gio.h>
index 1e079c2ccc7d2d4a7643987b69076938d27a60e2..cb2bcf0236cc0c638c8c1208ba6093df75a55c6c 100644 (file)
 #include "gtkbuilderprivate.h"
 
 #include "gdkpixbufutilsprivate.h"
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
 #include "gtkbuilderlistitemfactory.h"
 #include "gtkbuilderscopeprivate.h"
 #include "gtkdebug.h"
index 78385499a9c5bb2bc35cd6e98280f84cc0432a80..3ea04b941f0303caba7ca9aba36e375cac8b9840 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "gtkbuilderprivate.h"
 
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
 #include "gtkbuilderscopeprivate.h"
 #include "gtkdebug.h"
 #include "gtkintl.h"
index 9360dc1606a56eec270c8fa8dd3bc4419a57ca0a..4a06a2393eb6d69edf4f4fd0113ebb150e6ab1ec 100644 (file)
@@ -21,7 +21,7 @@
 #include <gio/gio.h>
 #include "gtkbuilderprivate.h"
 #include "gtkbuilder.h"
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
 
 /*****************************************  Record a GMarkup parser call ***************************/